
\usepackage[top=2.54cm, bottom=2.54cm, left=3.18cm, right=3.18cm]{geometry}
\usepackage[colorlinks, linkcolor=blue]{hyperref}
\usepackage{balance, fancyhdr}
\usepackage[perpage]{footmisc}
\usepackage{titlesec, caption}
\usepackage{xfrac, upgreek}
\usepackage{amsmath, amsthm, yhmath}
\usepackage{fontspec, txfonts, pifont}
\usepackage{tikz, tkz-euclide}
\usepackage{graphicx, incgraph}
\usepackage[x11names]{xcolor}
\usepackage{booktabs, multirow, array}

\pagestyle{fancy}
\fancyhead[RO,LE]{\thepage} \fancyfoot[C]{}
\fancyfoot[LE]{\small
  Copyright \copyright\ 2024 \textbf{Liu One}
  \quad \emph{All rights reserved.}}
\fancyfoot[RO]{\small\textit{版权所有，侵权必究。}}
\setlength{\headheight}{12.64723pt}
\addtolength{\topmargin}{-0.64723pt}

\titleformat{\section}{\bfseries}{总第\thesection 题}{.5em}{\LARGE\ttfamily}
\titleformat{\subsection}{\large\bfseries}{方法\chinese{subsection}：}{0pt}{\itshape}
\titleformat{\subsubsection}{\bfseries}{第\chinese{subsubsection}步}{.5em}{}

\renewcommand\thefootnote{\ding{\numexpr171+\value{footnote}}}

\setmainfont{Times New Roman}
\setsansfont{Helvetica}
\setmonofont[BoldFont={Andale Mono}]{Andale Mono}
\setCJKmainfont[
  BoldFont={黑体-简 中等}, ItalicFont={楷体-简},
  BoldItalicFont={宋体-简 黑体}]{宋体-简}
\setCJKsansfont{黑体-简}
\setCJKmonofont[BoldFont=华文仿宋]{华文仿宋}

\allowdisplaybreaks
\numberwithin{equation}{section}
\newtheorem{lemma}{引理}[section]

\captionsetup{format=hang, font=small, labelfont=bf, labelsep=quad}

\columnsep=3em
\columnseprule=.5pt

\usetikzlibrary{
  angles, quotes, calc, intersections, through, shadows,
  decorations.pathmorphing}
\tikzset{
  mark angle/.style n args={3}{    % deprecated
    draw=#1!50, fill=#1!20,
    angle radius=#2, angle eccentricity=#3,
  },
  opafill/.style n args={1}{       % deprecated
    fill=#1!50, fill opacity=.5,
  },
}

\setcounter{tocdepth}{2}
\newcommand\prob[2]{ \section{#1\normalsize\ #2} \label{sec:#1} }
\newcommand\ans[1]{\noindent\hrulefill\\\textbf{答案}\quad#1\hfill}
\newcommand\problabels[2][]{
  \hfill \foreach \labelcolor/\labelname in {#2} {
    \tikz[baseline=($ (label.center)!1/2!(label.south) $)]
      \node[draw, rectangle, rounded corners=3pt,
        fill=\labelcolor!20, inner sep=2pt,
        minimum height=13pt, #1] (label) {
          \footnotesize\textit{\labelname}}; } }
\newcommand\image[1]{\input{images/#1}}

\let\oldcong\cong \let\oldsim\sim
\renewcommand\cong{\ \reflectbox{$\oldcong$}\ }
\renewcommand\sim{\ \reflectbox{$\oldsim$}\ }
\DeclareMathOperator\dif{d\!}
\renewcommand\pi{\uppi}
\newcommand\mathe{\mathrm{e}}
\newcommand\mathi{\mathrm{i}}
\newcommand\lcm{\mathrm{lcm}}
\newcommand\rttri{\mathrm{Rt}\triangle}

\newcommand\calclen[4]{sqrt((#1-#3)^2+(#2-#4)^2)} % deprecated
\newcommand\calcdotpos[3]{(#1+#3*(#2-#1))}        % deprecated
\newcommand\calcbisectorx[6]{\calcdotpos#1#5{     % deprecated
  \calclen#1#2#3#4/(\calclen#1#2#3#4+\calclen#3#4#5#6)}}
\newcommand\calcbisectory[6]{\calcdotpos#2#6{     % deprecated
  \calclen#1#2#3#4/(\calclen#1#2#3#4+\calclen#3#4#5#6)}}
